package com.wc.AlgoOJ_train.train1.c1.A106;

import java.util.Locale;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/12/26 9:58
 * 进制转换
 * http://43.138.190.70:8888/p/A106
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            int num = sc.nextInt();
            int radix = sc.nextInt();
            System.out.println(Integer.toString(num, radix).toUpperCase(Locale.ROOT));
        }
    }
}
